package com.projects.android.dto;

import java.util.ArrayList;

import org.json.JSONException;
import org.json.JSONObject;

public class FoodDTO {
	private int ID;
	private int IDMenu;
	private String MenuName;
	private String Name;
	private float Price;
	private String Image;
	private String ContentType;
	private int Quantity;
	private ArrayList<OrderDetailDTO> OrderDetails;

	public String toString() {
		return Name;
	}

	public void initObject(JSONObject data) {
		try {
			ID = Integer.valueOf(data.getString("ID"));
			IDMenu = Integer.valueOf(data.getString("IDMenu"));

			if (!data.getString("Price").equals("")) {
				Price = Float.valueOf(data.getString("Price"));
			}
			Image = data.getString("Image");
			ContentType = data.getString("ContentType");
			Name = data.getString("Name");
			Quantity = 1;
			OrderDetails = new ArrayList<OrderDetailDTO>();
		} catch (NumberFormatException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (JSONException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}

	public int getID() {
		return ID;
	}

	public void setID(int iD) {
		ID = iD;
	}

	public int getIDMenu() {
		return IDMenu;
	}

	public void setIDMenu(int iDMenu) {
		IDMenu = iDMenu;
	}

	public String getName() {
		return Name;
	}

	public void setName(String name) {
		Name = name;
	}

	public float getPrice() {
		return Price;
	}

	public void setPrice(float price) {
		Price = price;
	}

	public String getImage() {
		return Image;
	}

	public void setImage(String image) {
		Image = image;
	}

	public String getContentType() {
		return ContentType;
	}

	public void setContentType(String contentType) {
		ContentType = contentType;
	}

	public ArrayList<OrderDetailDTO> getOrderDetails() {
		return OrderDetails;
	}

	public void setOrderDetails(ArrayList<OrderDetailDTO> orderDetails) {
		OrderDetails = orderDetails;
	}

	public String getMenuName() {
		return MenuName;
	}

	public void setMenuName(String menuName) {
		MenuName = menuName;
	}

	public int getQuantity() {
		return Quantity;
	}

	public void setQuantity(int quantity) {
		Quantity = quantity;
	}
}
